package com.ruoyi.business.domain;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 流程定义明细对象 bus_bpmn_info
 *
 * @author ruoyi
 * @date 2022-02-09
 */
public class BpmnInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Long id;

    /**
     * 流程(图)名称
     */
    @Excel(name = "流程(图)名称")
    private String bpmnName;

    /**
     * 流程(图)类型
     */
    @Excel(name = "流程(图)类型")
    private String bpmnType;

    /**
     * 流程部署id
     */
    @Excel(name = "流程部署id")
    private String deploymentId;

    /**
     * activity流程定义生成的主键
     */
    @Excel(name = "activity流程定义生成的主键")
    private String actProcessId;

    /**
     * activity流程定义生成的key
     */
    @Excel(name = "activity流程定义生成的key")
    private String actProcessKey;

    /**
     * 部署时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "部署时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date deployTime;

    /**设置结束时间取值范围*/
    public void setEndTime(Date endTime){
        if (endTime == null) {
            super.getParams().put("endTime",null);
            return;
        }
        Calendar instance = Calendar.getInstance();
        instance.setTime(endTime);
        instance.add(Calendar.DATE,1);
        String format = new SimpleDateFormat("yyyy-MM-dd").format(instance.getTime());
        super.getParams().put("endTime",format);
    }
    /**
     * 描述信息
     */
    @Excel(name = "描述信息")
    private String info;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setBpmnName(String bpmnName) {
        this.bpmnName = bpmnName;
    }

    public String getBpmnName() {
        return bpmnName;
    }

    public void setBpmnType(String bpmnType) {
        this.bpmnType = bpmnType;
    }

    public String getBpmnType() {
        return bpmnType;
    }

    public void setDeploymentId(String deploymentId) {
        this.deploymentId = deploymentId;
    }

    public String getDeploymentId() {
        return deploymentId;
    }

    public void setActProcessId(String actProcessId) {
        this.actProcessId = actProcessId;
    }

    public String getActProcessId() {
        return actProcessId;
    }

    public void setActProcessKey(String actProcessKey) {
        this.actProcessKey = actProcessKey;
    }

    public String getActProcessKey() {
        return actProcessKey;
    }

    public void setDeployTime(Date deployTime) {
        this.deployTime = deployTime;
    }

    public Date getDeployTime() {
        return deployTime;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public String getInfo() {
        return info;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("bpmnName", getBpmnName())
                .append("bpmnType", getBpmnType())
                .append("deploymentId", getDeploymentId())
                .append("actProcessId", getActProcessId())
                .append("actProcessKey", getActProcessKey())
                .append("deployTime", getDeployTime())
                .append("info", getInfo())
                .toString();
    }
}
